package indiwood.model.dao;

import indiwood.model.CinemaVO;
import indiwood.model.DirectorVO;
import indiwood.model.MovieVO;
import indiwood.model.ShowingVO;

import java.util.List;

import javax.annotation.Resource;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class MovieDAOImpl implements MovieDAO {
	@Resource(name="sqlSessionTemplate")
	private SqlSessionTemplate sqlSessionTemplate;	
	@Override
	public List<DirectorVO> getDirectorList(String pageNo) {
		return sqlSessionTemplate.selectList("movie.getDirectorList", pageNo);
	}
	@Override
	public int directorTotalContent() {
		return sqlSessionTemplate.selectOne("movie.directorTotalContent");
	}
	@Override
	public DirectorVO getDirectorContent(int no) {
		return sqlSessionTemplate.selectOne("movie.getDirectorContent", no);
	}
	@Override
	public List<MovieVO> getMovieList(int no) {
		return sqlSessionTemplate.selectList("movie.getMovieList", no);
	}
	@Override
	public List<String> getAwardList(int no) {
		return sqlSessionTemplate.selectList("movie.getAwardList", no);
	}
	@Override
	public CinemaVO defaultCinema() {
		return sqlSessionTemplate.selectOne("movie.defaultCinema");
	}
	@Override
	public CinemaVO cinemaContent(int cinemaNo) {
		return sqlSessionTemplate.selectOne("movie.cinemaContent", cinemaNo);
	}
	@Override
	public CinemaVO cinemaListBylatlng(CinemaVO cvo) {
		return sqlSessionTemplate.selectOne("movie.cinemaListBylatlng",cvo);
	}
	@Override
	public List<CinemaVO> cinemaList() {
		return sqlSessionTemplate.selectList("movie.cinemaList");
	}
	@Override
	public int soonListTotalContent() {
		return sqlSessionTemplate.selectOne("movie.soonListTotalContent");
	}
	@Override
	public List<ShowingVO> getSoonListByPage(String pageNo) {
		return sqlSessionTemplate.selectList("movie.getSoonListByPage", pageNo);
	}
	@Override
	public int showingListTotalContent() {
		return sqlSessionTemplate.selectOne("movie.showingListTotalContent");
	}
	@Override
	public List<ShowingVO> getShowingListByPage(String pageNo) {
		return sqlSessionTemplate.selectList("movie.getShowingListByPage", pageNo);
	}
	@Override
	public MovieVO movieContent(int movieNo) {
		return sqlSessionTemplate.selectOne("movie.movieContent",movieNo);
	}
}
